# Author: Yuan Li
# Titile: 15123-lab3 makefile to generate main.exe
# Date: Aug 10th 2011

CC= gcc 
FLAGS= -ansi -pedantic -W -Wall -Wextra -O2 -g
# -g will use debug mode to help valgrind locate error

lab-03-main.exe: lab-03-main.o lab-03-lib.o
	$(CC)$(FLAGS) -o lab-03-main.exe lab-03-main.o lab-03-lib.o

lab-03-main.o: lab-03-main.c lab-03.h
	$(CC)$(FLAGS) -c lab-03-main.c

lab-03-lib.o: lab-03-lib.c
	$(CC)$(FLAGS) -c lab-03-lib.c

clean:
	rm lab-03-lib.o lab-03-main.o lab-03-main.exe

leak:
	valgrind --tool=memcheck --leak-check=full --show-reachable=yes ./lab-03-main.exe 479622-randomized-words.txt 10K-words-output.txt

105:
	./lab-03-main.exe 105-words.txt 105-words-output.txt

10K:
	./lab-03-main.exe 10K-words.txt 10K-words-output.txt

10:
	./lab-03-main.exe 10-words.txt
